home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 5 / Amiga Tools 5.iso / tools / developer-tools / andere sprachen / gamesmaster / includes / games / games.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-07-16  |  11.2 KB  |  344 lines

  1. #ifndef GAMES_GMS_H
  2. #define GAMES_GMS_H TRUE
  3.  
  4. /*
  5. **    $VER: games.h 0.2 (05.7.96)
  6. **    Includes Release xx.xx
  7. **
  8. **    General include file for programs using the Games Master System.
  9. **
  10. **    (C) Copyright 1996 DreamWorld Productions.
  11. **        All Rights Reserved
  12. */
  13.  
  14. #ifndef EXEC_TYPES_H
  15. #include <exec/types.h>
  16. #endif
  17.  
  18. #define FILTER_OFF   0
  19. #define FILTER_ON    1
  20.  
  21. /*
  22. ** --- Universal joystick status bits returned from Read_Joystick, Sega,
  23. **     JoyPad, etc...
  24. */
  25.  
  26. #define JS_LEFT   (1L<<0)          /* X axis */
  27. #define JS_RIGHT  (1L<<1)
  28. #define JS_UP     (1L<<2)          /* Y axis */
  29. #define JS_DOWN   (1L<<3)
  30. #define JS_ZIN    (1L<<4)          /* Z axis!  Reserved for later... */
  31. #define JS_ZOUT   (1L<<5)
  32. #define JS_FIRE1  (1L<<6)          /* Fire Buttons */
  33. #define JS_FIRE2  (1L<<7)          /* <-For 2 button joysticks */
  34.  
  35. #define JS_RED    (1L<<6)
  36. #define JS_BLUE   (1L<<7)
  37. #define JS_PLAY   (1L<<8)          /* CD32 buttons here */
  38. #define JS_RWD    (1L<<9)
  39. #define JS_FFW    (1L<<10)
  40. #define JS_GREEN  (1L<<11)
  41. #define JS_YELLOW (1L<<12)
  42.  
  43. #define JB_FIRE1  (1L<<16)         /* For the ZBXY style return type */
  44. #define JB_FIRE2  {1L<<17)         /*  (analog joysticks) */
  45.  
  46. #define M_LMB     (1L<<0)
  47. #define M_RMB     (1L<<1)
  48. #define M_MMB     (1L<<2)
  49.  
  50. /* --- Joyport specifications for calling Read_JoyStick/Mouse/JoyPad...() */
  51.  
  52. #define JPORT1    0*2
  53. #define JPORT2    1*2
  54. #define JPORT3    2*2
  55. #define JPORT4    3*2
  56.  
  57. /* --- Raster/Copper commands for RasterLists. */
  58.  
  59. #define COL12Len      10        /* COL12,Line,Colour,RGB */
  60. #define COL12LISTLen  16        /* COL12LIST,Line,Skip,Colour,RGB */
  61. #define COL24LISTLen  16        /* COL24LIST,Line,Skip,Colour,RRGGBB */
  62. #define COL24Len      12        /* COL24,Line,Colour,RRGGBB */
  63. #define SPRITELen     10        /* SPRITE,Line,SpriteStruct */
  64. #define SCROLLLen      8        /* SCROLL,Line,Offset */
  65. #define FSCROLLLen    10        /* FSCROLL,Line,Offset */
  66. #define FLOODLen       6        /* FLOOD,Line */
  67. #define REPOINTLen    10        /* REPOINT,Line,BitPtr */
  68. #define MIRRORLen      6        /* MIRROR,Line */
  69. #define NEWPALETTELen 14        /* NEWPALETTE,Line,ColStart,AmtCols,Palette */
  70. #define WAITLINELen    8
  71.  
  72. #define COL12        0
  73. #define COL24        1
  74. #define COL12LIST   2
  75. #define COL24LIST   3
  76. #define SPRITE        4
  77. #define SCROLL        5
  78. #define FSCROLL     6
  79. #define FLOOD       7
  80. #define REPOINT     8
  81. #define MIRROR      9
  82. #define NEWPALETTE 10
  83. #define WAITLINE   11
  84. #define RASTEND       -1
  85.  
  86. /* --- GPI ID numbers. */
  87.  
  88. #define GPI_SCREENS  0
  89. #define GPI_BLITTER  1
  90. #define GPI_SOUND    2
  91. #define GPI_NETWORK  3
  92. #define GPI_VECTORS  4
  93. #define GPI_DEBUG    5
  94.  
  95. /* --- Standard screen structure. */
  96.  
  97.   struct   GameScreen
  98.     {
  99.     char   SS_VERSION[4];           /* Structure version - "GSV1" */
  100.     APTR   SS_MemPtr1;              /* Ptr to screen 1 */
  101.     APTR   SS_MemPtr2;              /* Ptr to screen 2 (if buffered) */
  102.     APTR   SS_MemPtr3;              /* Ptr to screen 3 (triple buffer!!) */
  103.     APTR   SS_ScreenLink;           /* Ptr to a linked screen */
  104.     APTR   SS_Palette;              /* Ptr to the screen palette */
  105.     APTR   SS_RasterList;           /* Ptr to a rasterlist */
  106.     ULONG  SS_AmtColours;           /* The amount of colours in the palette. */
  107.     UWORD  SS_Scr_Height;           /* The height of the visible screen */
  108.     UWORD  SS_Scr_Width;            /* The width of the visible screen */
  109.     UWORD  SS_Scr_ByteWidth;        /* Width of the screen in _bytes_ */
  110.     UWORD  SS_Pic_Height;           /* The height of the entire screen */
  111.     UWORD  SS_Pic_Width;            /* The width of the entire screen */
  112.     UWORD  SS_Pic_ByteWidth;        /* Width of the entire screen, bytes */
  113.     UWORD  SS_Planes;               /* The amount of planes in da screen */
  114.     WORD   SS_TopOfScrX;            /* Hardware co-ordinate for TOS */
  115.     WORD   SS_TopOfScrY;            /* Hardware co-ordinate for LOS */
  116.     UWORD  SS_ScrollBuffer;         /* Scroll buffer in pixels */
  117.     WORD   SS_ScrollXCount;         /* Offset of the horizontal axis */
  118.     WORD   SS_ScrollYCount;         /* Offset of the vertical axis */
  119.     ULONG  SS_ScrAttrib;            /* Special Attributes are? */
  120.     UWORD  SS_ScrMode;              /* What screen mode is it? */
  121.     UBYTE  SS_ScrType;              /* Interleaved or Sequential? */
  122.     UBYTE  SS_Displayed;            /* Am I currently displayed? */
  123.     APTR   SS_Extended;             /* Private */
  124.     APTR   SS_ScreenStats;          /* Private */
  125.     };
  126.  
  127. #define INTERLEAVED  0              /* These are actual numbers */
  128. #define PLANAR       1              /* rather than bits */
  129. #define CHUNKY       2
  130.                                     /* SCREEN ATTRIBUTES */
  131. #define DBLBUFFER  0x00000001       /* For double buffering */
  132. #define TPLBUFFER  0x00000002       /* Triple buffering!! */
  133. #define PLAYFIELD  0x00000004       /* Set if it's part of a playfield */
  134. #define HSCROLL    0x00000008       /* Gotta set this to do scrolling */
  135. #define VSCROLL    0x00000010       /* For vertical scrolling */
  136. #define SPRITES    0x00000020       /* Set this if you want sprites */
  137. /*                 0x00000040       */
  138. #define NOBURST    0x00000080       /* This forces burst mode to off */
  139. #define BLKBDR     0x00000100       /* Gives a blackborder on AGA machines */
  140. #define NOSPRBDR   0x00000200       /* For putting sprites in the border */
  141. /*                 0x00000400       */
  142. #define SPR32      0x00000800       /* Set one of these if you will */
  143. #define SPR64      0x00001000       /*   be using sprites larger than 16X */
  144.  
  145.                                     /* SCREEN MODES */
  146. #define LORES      0x0000           /* Low resolution (default) */
  147. #define HIRES      0x0001           /* High resolution */
  148. #define SHIRES     0x0002           /* Super-High resolution */
  149. #define INTERLACED 0x0004           /* Interlaced */
  150. #define NTSC       0x0020           /* Set if you wrote this game in NTSC */
  151. #define HAM        0x0040           /* For HAM mode */
  152. #define _24BITCOL  0x0080           /* 24Bit colours (default is 12Bits) */
  153.  
  154. /* --- Universal errorcodes returned by certain functions --- */
  155.  
  156. #define ERR_OK     0           /* Function went OK (also NULL) */
  157. #define ERR_NOMEM  1           /* Not enough memory available */
  158. #define ERR_NOPTR  2           /* Relevant ptr not present */
  159. #define ERR_INUSE  3           /* Previous allocations have not been freed */
  160. #define ERR_NOVER  4           /* Structure version not supported/not found */
  161.  
  162. /* --- Sprite structure --- */
  163.  
  164.  struct  SpriteStruct
  165.    {
  166.    UWORD SPR_Number;
  167.    APTR  SPR_Address;        /* Pointer to Sprite graphic */
  168.    WORD  SPR_XPos;
  169.    WORD  SPR_YPos;
  170.    UWORD SPR_Frame;
  171.    UWORD SPR_Width;
  172.    UWORD SPR_Height;
  173.    UWORD SPR_AmtColours;     /* 4/16 */
  174.    UWORD SPR_ColStart;
  175.    UWORD SPR_Planes;
  176.    UWORD SPR_Resolution;     /* HiRes/LoRes/SHiRes/XLONG */
  177.    
  178.    ULONG SPR_SpriteSize;     /* Must be initialized */
  179.    ULONG SPR_FrameSize;      /* Must be initialized */
  180.    };
  181.  
  182. #define SPR_OCS 0x0010
  183. #define SPR_AGA 0x0020
  184. #define XLONG   0x0040
  185.  
  186.  
  187. /* --- BOB structure */
  188.  
  189.  struct BOBStruct
  190.   {
  191.   UWORD BOB_Frame;           /* Current frame */
  192.   APTR  BOB_Frame_List;      /* Pointer to frame list */
  193.   WORD  BOB_XPos;            /* X position */
  194.   WORD  BOB_YPos;            /* Y position */
  195.   UWORD BOB_Height;          /* Height */
  196.   UWORD BOB_ByteWidth;       /* Width in bytes */
  197.   WORD  BOB_ClipLeft;        /* "Clip Area" border restrictions */
  198.   WORD  BOB_ClipTop;
  199.   WORD  BOB_ClipRight;
  200.   WORD  BOB_ClipBottom;
  201.   UWORD BOB_Attributes;      /* Mask/Chunky/Planar/Interleaved */
  202.   UWORD BOB_Amt_Planes;      /* Amt of planes */
  203.   UWORD BOB_First_Plane;     /* Planar only */
  204.   UWORD BOB_Draw_Method;
  205.   UWORD BOB_BackGrnd_Info;   /* Is a background stored? */
  206.   APTR  BOB_BackGrnd_Ptr;    /* Where is the background stored? */
  207.       
  208.   APTR  FB_Draw_Routine;     /* Private stuff here! */
  209.   APTR  FB_Clear_Routine;    /* Don't ever touch this stuff! */
  210.   ULONG FB_BlitSize;
  211.   ULONG FB_Modulo1;
  212.   ULONG FB_Modulo2;
  213.   UWORD FB_LineSize;
  214.   UWORD FB_BotCut;
  215.   UWORD FB_TBWidth;
  216.   WORD  FB_Reserved;
  217.   };
  218.  
  219. /* --- BOB Drawing Methods */
  220.  
  221. #define INTLV_NCNM  00       /* No clip, no mask */
  222. #define INTLV_NCYM  01       /* No clip, masked */
  223. #define INTLV_YCNM  02       /* Clip, no mask */
  224. #define INTLV_YCYM  03       /* Clip, masked */
  225.  
  226. /* PLANAR */
  227. #define PLNR_NCNM   04
  228. #define PLNR_NCYM   05
  229. #define PLNR_YCNM   06
  230. #define PLNR_YCYM   07
  231.  
  232. /* CHUNKY */
  233. #define CHNKY_NCNM  08
  234. #define CHNKY_NCYM  09
  235. #define CHNKY_YCNM  10
  236. #define CHNKY_YCYM  11
  237.  
  238. /* --- Sound stuff */
  239.  
  240. #define CHAN_FREE    0       /* For Check_Channel() */
  241.  
  242. #define CHANNEL_ALL -1
  243. #define CHANNEL_1    0
  244. #define CHANNEL_2    1
  245. #define CHANNEL_3    2
  246. #define CHANNEL_4    3
  247.  
  248. #define RAW   0
  249. #define IFF   1
  250. #define WAV   2
  251.  
  252.  struct SoundStruct
  253.   {
  254.   WORD  SAM_Type;            /* IFF/WAV/RAW/ */
  255.   WORD  SAM_Channel;         /* Channel, 0-3 */
  256.   WORD  SAM_Priority;        /* Priority, 0-127 */
  257.   LONG  SAM_Address;         /* Address of sample data */
  258.   WORD  SAM_Length;          /* Length of sample data in WORDS */
  259.   WORD  SAM_Period;          /* Speed of playback */
  260.   WORD  SAM_Volume;          /* Volume of sample */
  261.   };
  262.  
  263. /* --- Choose one of these for calling Set_Interrupt() --- */
  264.  
  265. #define INTB_INTEN   14   /* Master interrupt (enable only ) */
  266. #define INTB_EXTER   13   /* External interrupt */
  267. #define INTB_DSKSYNC 12   /* Disk re-SYNChronized */
  268. #define INTB_RBF     11   /* serial port Receive Buffer Full */
  269. #define INTB_AUD3    10   /* Audio channel 3 block finished */
  270. #define INTB_AUD2     9   /* Audio channel 2 block finished */
  271. #define INTB_AUD1     8   /* Audio channel 1 block finished */
  272. #define INTB_AUD0     7   /* Audio channel 0 block finished */
  273. #define INTB_BLIT     6   /* Blitter finished */
  274. #define INTB_VERTB    5   /* start of Vertical Blank */
  275. #define INTB_COPER    4   /* Coprocessor */
  276. #define INTB_PORTS    3   /* I/O Ports and timers */
  277. #define INTB_SOFTINT  2   /* software interrupt rest */
  278. #define INTB_DSKBLK   1   /* Disk Block done */
  279. #define INTB_TBE      0   /* serial port Transmit Buffer Empty */
  280.  
  281. /* --- Special Keypresses that can be returned from Read_Key().  All other
  282. ** keys can be considered to be in ASCII format.
  283. */
  284.  
  285.  struct KeyStruct
  286.   {
  287.   WORD  KP_ID;
  288.   BYTE  KP_Qualifier;
  289.   BYTE  KP_Key;
  290.   BYTE  KP_PQualifier;   /* Older keys */
  291.   BYTE  KP_PKey;
  292.   };
  293.  
  294. #define K_BAKSPC  0x80
  295. #define K_DEL     0x81
  296. #define K_HELP    0x82
  297.  
  298. #define K_LSHIFT  0x83
  299. #define K_RSHIFT  0x84
  300. #define K_CAPS    0x85
  301. #define K_CTRL    0x86
  302. #define K_LALT    0x87
  303. #define K_RALT    0x88
  304. #define K_LAMIGA  0x89
  305. #define K_RAMIGA  0x8a
  306.  
  307. #define K_F1      0x8b
  308. #define K_F2      0x8c
  309. #define K_F3      0x8d
  310. #define K_F4      0x8e
  311. #define K_F5      0x8f
  312. #define K_F6      0x90
  313. #define K_F7      0x91
  314. #define K_F8      0x92
  315. #define K_F9      0x93
  316. #define K_F10     0x94
  317. #define K_F11     0x95
  318. #define K_F12     0x96
  319. #define K_F13     0x97
  320. #define K_F14     0x98
  321. #define K_F15     0x99
  322. #define K_F16     0x9a
  323. #define K_F17     0x9b
  324. #define K_F18     0x9c
  325. #define K_F19     0x9d
  326. #define K_F20     0x9e
  327.  
  328. #define C_UP      0x9f
  329. #define C_DOWN    0xa0
  330. #define C_RIGHT   0xa1
  331. #define C_LEFT    0xa2
  332.  
  333. #define K_SRIGHT  0xa3       /* Special key on right */
  334. #define K_SLEFT   0xa4       /* Special key on left */
  335.  
  336. /* --- Special keys that are recognised under ASCII (here for convenience)*/
  337.  
  338. #define K_ENTER  10
  339. #define K_RETURN 10
  340. #define K_TAB    09
  341. #define K_ESC    ""
  342.  
  343. #endif
  344.